package vh.sphynx.runtime.pattern;

import vh.sphynx.runtime.TypeConverter;

public class PatternMatchInfoTypeConverter extends TypeConverter {

	@Override
	public Object convertTo(Object value, Class<?> sourceType, Class<?> targetType) {
		if (targetType == Boolean.class)
			return ((PatternMatchInfo)value).isMatched();
		return super.convertTo(value, sourceType, targetType);
	}

	@Override
	public boolean canConvertTo(Class<?> sourceType, Class<?> targetType) {
		if (targetType == Boolean.class)	
			return true;
		return super.canConvertTo(sourceType, targetType);
	}

}
